#ifndef QMLSETTING_H
#define QMLSETTING_H
#include <QString>
#include <QSettings>
#include <QStringList>

class QmlSetting : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString appName WRITE setAppName)

public:
    QmlSetting();
    void setAppName(QString p_appname);
    Q_INVOKABLE QVariant value(QString key);
    Q_INVOKABLE bool isValue(QString key);
    Q_INVOKABLE QVariant conf(QString key,QVariant defaultValue);
    Q_INVOKABLE QVariant validValue(QString key,QVariant defaultValue);
    Q_INVOKABLE QStringList getListKeys(QString key);
    Q_INVOKABLE inline void beginGroup(QString group){innerSetting->beginGroup(group);}
    Q_INVOKABLE inline void endGroup(){innerSetting->endGroup();}

private:
     QSettings * innerSetting;

};

#endif // QMLSETTING_H
